Tutorial: GMOS Imaging Reduction - NGC 3310 - r-band

Datasets:

Science observation UT date(s) 2015 Dec 14
Data filename prefix(es) N20151214S

Target Frames

ScienceN20151214S243-246binning 2x2
Processed Biasfor 20151214N20151214S0346_bias.fits
Processed Twilight Flatfor 20151214N20151208S0225_flat_r.fits
Processed Fringe FrameN/AN/A

Fringe Frames

N/A

Twilight Flats

Processed: N20151208S0225_flat_r.fits
Twilight FramesN20151208S225-233binning 2x2
Processed Biasfor 20151208N20151208S0272_bias.fits

Biases

Processed: N20151214S0346_bias.fits
BiasesN20151214S346-350binning 2x2
Processed: N20151208S0272_bias.fits
BiasesN20151208S272-276binning 2x2

STEP 0: Directory structure used by this Notebook

The directory paths used in this notebook are assumed to match this structure:

rootdir/
    calib/
        bias/
        flat/
        fringe/
    raw/
    redux/

STEP 1: Set up the Notebook and the PyRAF session

The data processing will happen in the Notebook. It is also convenient to have a PyRAF interactive session ready to use if needed, eg. to imexam. In this step, we will configure the Notebook and the PyRAF session.

This step needs to be repeated everytime the Notebook and/or the PyRAF session is restarted.

STEP 1.1: Set up the Notebook

STEP 1.1.1: Set up the variables.


In [1]:
import os
import os.path
import shutil

# WARNING: Make sure that the directory structure given in Step 0 
#          is already in place.

# EDIT HERE - Directories
rootdir = '/data/workspace/DRWorkshopAAO/NGC3310'

# EDIT HERE - File numbers and file names
biases = {
    'bias_20151214' : {
        'procbias' : 'N20151214S0346_bias.fits',
        'frames'   : [('N20151214S', '346-350'),
                     ]
    },
    'bias_20151208' : {
        'procbias'   : 'N20151208S0272_bias.fits',
        'frames'     : [('N20151208S', '272-276')],
    }
}

flats = {
    'flat_20151208' : {
        'procflat'   : 'N20151208S0225_flat_r.fits',
        'frames'     : [('N20151208S', '225-233')],
        'flatbias'   : biases['bias_20151208']['procbias'],
    }
}

science = {
    'procsci'   : 'ngc3310_r.fits',
    'sciroot'   : 'N20151214S',
    'sciframes' : '243-246',
    'scibias'   : biases['bias_20151214']['procbias'],
    'sciflat'   : flats['flat_20151208']['procflat'],
    #'scifringe' : fringes['fringe_20101111']['procfringe'],
}

logfile = 'NGC3310_r.log'

# Automatically set directories to match structure from Step 0
raw_path = os.path.join(rootdir, 'raw') + '/'
redux_path = os.path.join(rootdir, 'redux') + '/'
procbias_path = os.path.join(rootdir, 'calib', 'bias') + '/'
procflat_path = os.path.join(rootdir, 'calib', 'flat') + '/'
procfringe_path = os.path.join(rootdir, 'calib', 'fringe') + '/'
products_path = os.path.join(rootdir, 'products') + '/'

# Change to work directory
os.chdir(redux_path)

Step 1.1.2: Load and initialize the package

---> LAUNCH DS9 before proceeding further

Load the package required for the Notebook session and reset tasks to the default parameters.


In [2]:
from pyraf import iraf
iraf.gemini()
iraf.gmos()

iraf.unlearn(iraf.gemini, iraf.gmos, iraf.gemtools)

iraf.gmos.logfile = logfile

iraf.set(stdimage='imtgmos')


This is the initial release of the IRAF FITSUTIL package
to include support for FITS tile compression via 'fpack'.
Please send comments and questions to seaman@noao.edu.

 
     +------------------- Gemini IRAF Package -------------------+
     |             Version 1.13.1, December 7, 2015              |
     |             Requires IRAF v2.14.1 or greater              |
     |              Tested with Ureka IRAF v2.16                 |
     |             Gemini Observatory, Hilo, Hawaii              |
     |    Please use the help desk for submission of questions   |
     |  http://www.gemini.edu/sciops/helpdesk/helpdeskIndex.html |
     +-----------------------------------------------------------+
 
     Warning setting imtype=fits
     Warning setting use_new_imt=no
 
gemini/:
 f2/            gemtools/       gsaoi/          niri/
 flamingos/     gmos/           midir/          oscir/
 gemlocal/      gnirs/          nifs/           quirc/
gmos/:
 gbias          gfquick         gmosaic         gsappwave       gssdist
 gbpm           gfreduce        gmosexamples    gscalibrate     gsskysub
 gdark          gfresponse      gmosinfo        gscrmask        gsslitfunction
 gdisplay       gfscatsub       gmosinfoifu     gscrrej         gsstandard
 gfapsum        gfskysub        gmosinfoimag    gscut           gstransform
 gfcombine      gftransform     gmosinfospec    gsdrawslits     gswavelength
 gfcopy         giflat          gnscombine      gsextract       mostools/
 gfcube         gifringe        gnsdark         gsflat
 gfdisplay      giillum         gnsskysub       gsfquick
 gfextract      gireduce        gprepare        gsreduce
 gffindblocks   girmfringe      gqecorr         gsscatsub

STEP 1.2: Set up the PyRAF session

The commands shown here need to be run from the shell.

Open an xterm or a Terminal, then:

cd /data/workspace/DRWorkshopAAO/NGC3310/redux
pyraf

Then in the PyRAF session:

gemini
gmos
unlearn gemini
unlearn gmos
unlearn gemtools

Get your PyRAF configured. In the PyRAF session:

iraf.gmos.logfile = "NGC3310_r.log"
set stdimage=imtgmos

STEP 2: Create the file lists


In [3]:
os.chdir(redux_path)

# delete any pre-existing lists
iraf.delete('*.lis', verify='no')

# biases
for (root, frames) in biases['bias_20151214']['frames']:
    iraf.gemlist(root, frames, Stdout='tmp_'+root+'.lis')
iraf.concat('tmp_*.lis', 'bias_20151214.lis')
iraf.delete('tmp_*.lis', verify='no')

for (root, frames) in biases['bias_20151208']['frames']:
    iraf.gemlist(root, frames, Stdout='tmp_'+root+'.lis')
iraf.concat('tmp_*.lis', 'bias_20151208.lis')
iraf.delete('tmp_*.lis', verify='no')


# flats
for (root, frames) in flats['flat_20151208']['frames']:
    iraf.gemlist(root, frames, Stdout='tmp_'+root+'.lis')
iraf.concat('tmp_*.lis', 'flat_20151208.lis')
iraf.delete('tmp_*.lis', verify='no')


# science
iraf.gemlist(science['sciroot'], science['sciframes'], \
             Stdout='sci.lis')

# Get a full list
iraf.concat('*.lis', 'all.lis')

STEP 3: Visually inspect all the data


In [4]:
all_files = open('all.lis', 'r')
for line in all_files:
    image = line.strip() + '[1]'
    print image
    iraf.gdisplay(raw_path + image, 1, fl_paste='no')
    iraf.sleep(5)
    
all_files.close()


N20151208S0272[1]

GDISPLAY - Started: 2016-04-09T12:08:25

GDISPLAY: Temporary image name tmpout4367oN20151208S0272.fits

GMULTIAMP - Started: 2016-04-09T12:08:25


GMULTIAMP - Finished: 2016-04-09T12:08:26
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-04-09T12:08:28

N20151208S0273[1]

GDISPLAY - Started: 2016-04-09T12:08:33

GDISPLAY: Temporary image name tmpout4367_10N20151208S0273.fits

GMULTIAMP - Started: 2016-04-09T12:08:33


GMULTIAMP - Finished: 2016-04-09T12:08:34
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-04-09T12:08:36

N20151208S0274[1]

GDISPLAY - Started: 2016-04-09T12:08:41

GDISPLAY: Temporary image name tmpout4367_31N20151208S0274.fits

GMULTIAMP - Started: 2016-04-09T12:08:42


GMULTIAMP - Finished: 2016-04-09T12:08:43
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-04-09T12:08:45

N20151208S0275[1]

GDISPLAY - Started: 2016-04-09T12:08:50

GDISPLAY: Temporary image name tmpout4367_52N20151208S0275.fits

GMULTIAMP - Started: 2016-04-09T12:08:50


GMULTIAMP - Finished: 2016-04-09T12:08:51
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-04-09T12:08:53

N20151208S0276[1]

GDISPLAY - Started: 2016-04-09T12:08:58

GDISPLAY: Temporary image name tmpout4367_73N20151208S0276.fits

GMULTIAMP - Started: 2016-04-09T12:08:58


GMULTIAMP - Finished: 2016-04-09T12:08:59
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-04-09T12:09:01

N20151214S0346[1]

GDISPLAY - Started: 2016-04-09T12:09:06

GDISPLAY: Temporary image name tmpout4367_94N20151214S0346.fits

GMULTIAMP - Started: 2016-04-09T12:09:06


GMULTIAMP - Finished: 2016-04-09T12:09:07
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-04-09T12:09:09

N20151214S0347[1]

GDISPLAY - Started: 2016-04-09T12:09:14

GDISPLAY: Temporary image name tmpout4367_115N20151214S0347.fits

GMULTIAMP - Started: 2016-04-09T12:09:14


GMULTIAMP - Finished: 2016-04-09T12:09:15
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-04-09T12:09:17

N20151214S0348[1]

GDISPLAY - Started: 2016-04-09T12:09:22

GDISPLAY: Temporary image name tmpout4367_136N20151214S0348.fits

GMULTIAMP - Started: 2016-04-09T12:09:22


GMULTIAMP - Finished: 2016-04-09T12:09:23
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-04-09T12:09:26

N20151214S0349[1]

GDISPLAY - Started: 2016-04-09T12:09:31

GDISPLAY: Temporary image name tmpout4367_157N20151214S0349.fits

GMULTIAMP - Started: 2016-04-09T12:09:31


GMULTIAMP - Finished: 2016-04-09T12:09:32
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-04-09T12:09:34

N20151214S0350[1]

GDISPLAY - Started: 2016-04-09T12:09:39

GDISPLAY: Temporary image name tmpout4367_178N20151214S0350.fits

GMULTIAMP - Started: 2016-04-09T12:09:39


GMULTIAMP - Finished: 2016-04-09T12:09:40
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-04-09T12:09:42

N20151208S0225[1]

GDISPLAY - Started: 2016-04-09T12:09:47

GDISPLAY: Temporary image name tmpout4367_199N20151208S0225.fits

GMULTIAMP - Started: 2016-04-09T12:09:47


GMULTIAMP - Finished: 2016-04-09T12:09:48
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-04-09T12:09:50

N20151208S0226[1]

GDISPLAY - Started: 2016-04-09T12:09:55

GDISPLAY: Temporary image name tmpout4367_220N20151208S0226.fits

GMULTIAMP - Started: 2016-04-09T12:09:55


GMULTIAMP - Finished: 2016-04-09T12:09:56
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-04-09T12:09:59

N20151208S0227[1]

GDISPLAY - Started: 2016-04-09T12:10:04

GDISPLAY: Temporary image name tmpout4367_241N20151208S0227.fits

GMULTIAMP - Started: 2016-04-09T12:10:04


GMULTIAMP - Finished: 2016-04-09T12:10:05
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-04-09T12:10:07

N20151208S0228[1]

GDISPLAY - Started: 2016-04-09T12:10:12

GDISPLAY: Temporary image name tmpout4367_262N20151208S0228.fits

GMULTIAMP - Started: 2016-04-09T12:10:12


GMULTIAMP - Finished: 2016-04-09T12:10:13
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-04-09T12:10:15

N20151208S0229[1]

GDISPLAY - Started: 2016-04-09T12:10:20

GDISPLAY: Temporary image name tmpout4367_283N20151208S0229.fits

GMULTIAMP - Started: 2016-04-09T12:10:20


GMULTIAMP - Finished: 2016-04-09T12:10:21
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-04-09T12:10:23

N20151208S0230[1]

GDISPLAY - Started: 2016-04-09T12:10:28

GDISPLAY: Temporary image name tmpout4367_304N20151208S0230.fits

GMULTIAMP - Started: 2016-04-09T12:10:28


GMULTIAMP - Finished: 2016-04-09T12:10:30
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-04-09T12:10:32

N20151208S0231[1]

GDISPLAY - Started: 2016-04-09T12:10:37

GDISPLAY: Temporary image name tmpout4367_325N20151208S0231.fits

GMULTIAMP - Started: 2016-04-09T12:10:37


GMULTIAMP - Finished: 2016-04-09T12:10:38
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-04-09T12:10:40

N20151208S0232[1]

GDISPLAY - Started: 2016-04-09T12:10:45

GDISPLAY: Temporary image name tmpout4367_346N20151208S0232.fits

GMULTIAMP - Started: 2016-04-09T12:10:45


GMULTIAMP - Finished: 2016-04-09T12:10:46
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-04-09T12:10:48

N20151208S0233[1]

GDISPLAY - Started: 2016-04-09T12:10:53

GDISPLAY: Temporary image name tmpout4367_367N20151208S0233.fits

GMULTIAMP - Started: 2016-04-09T12:10:53


GMULTIAMP - Finished: 2016-04-09T12:10:54
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-04-09T12:10:56

N20151214S0243[1]

GDISPLAY - Started: 2016-04-09T12:11:01

GDISPLAY: Temporary image name tmpout4367_388N20151214S0243.fits

GMULTIAMP - Started: 2016-04-09T12:11:02


GMULTIAMP - Finished: 2016-04-09T12:11:03
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-04-09T12:11:05

N20151214S0244[1]

GDISPLAY - Started: 2016-04-09T12:11:10

GDISPLAY: Temporary image name tmpout4367_409N20151214S0244.fits

GMULTIAMP - Started: 2016-04-09T12:11:10


GMULTIAMP - Finished: 2016-04-09T12:11:11
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-04-09T12:11:13

N20151214S0245[1]

GDISPLAY - Started: 2016-04-09T12:11:18

GDISPLAY: Temporary image name tmpout4367_430N20151214S0245.fits

GMULTIAMP - Started: 2016-04-09T12:11:18


GMULTIAMP - Finished: 2016-04-09T12:11:19
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-04-09T12:11:21

N20151214S0246[1]

GDISPLAY - Started: 2016-04-09T12:11:26

GDISPLAY: Temporary image name tmpout4367_451N20151214S0246.fits

GMULTIAMP - Started: 2016-04-09T12:11:26


GMULTIAMP - Finished: 2016-04-09T12:11:27
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-04-09T12:11:29

STEP 4: Process the biases

This will produce the two biases defined above. Those two biases will be used later to process the science frames, the twilight flats, and the fringe frames.


In [5]:
os.chdir(redux_path)

for biaskey in biases.keys():
    iraf.imdelete(biases[biaskey]['procbias'], verify='no')
    iraf.imdelete('g//@'+biaskey+'.lis', verify='no')

    print 'Creating bias ', biases[biaskey]['procbias']
    iraf.gbias('@'+biaskey+'.lis', outbias=biases[biaskey]['procbias'], \
               rawpath=raw_path, fl_over='yes', fl_trim='yes', \
               fl_vardq='yes')
    shutil.copy(biases[biaskey]['procbias'], procbias_path)

# The processed biases are:
os.listdir(procbias_path)


Creating bias  N20151208S0272_bias.fits
----------------------------------------------------------------------------
GBIAS -- Sat Apr  9 12:12:10 HST 2016

Input images:
  N20151208S0272
  N20151208S0273
  N20151208S0274
  N20151208S0275
  N20151208S0276

Output bias image: N20151208S0272_bias.fits
 

----------------------------------------------------------------------------
GIREDUCE -- Sat Apr  9 12:12:11 HST 2016

----------------------------------------------------------------------------
GPREPARE -- Sat Apr  9 12:12:11 HST 2016

Input list    = /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151208S0272
Output list   = 
Output prefix = g
Raw path      = 
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151208S0272.fits   Output  gN20151208S0272.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Sat Apr  9 12:12:12 HST 2016

Input list    = /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151208S0273
Output list   = 
Output prefix = g
Raw path      = 
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151208S0273.fits   Output  gN20151208S0273.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Sat Apr  9 12:12:13 HST 2016

Input list    = /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151208S0274
Output list   = 
Output prefix = g
Raw path      = 
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151208S0274.fits   Output  gN20151208S0274.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Sat Apr  9 12:12:15 HST 2016

Input list    = /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151208S0275
Output list   = 
Output prefix = g
Raw path      = 
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151208S0275.fits   Output  gN20151208S0275.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Sat Apr  9 12:12:16 HST 2016

Input list    = /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151208S0276
Output list   = 
Output prefix = g
Raw path      = 
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151208S0276.fits   Output  gN20151208S0276.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------

Input files:
gN20151208S0272
gN20151208S0273
gN20151208S0274
gN20151208S0275
gN20151208S0276

Output files:
tmpfile4367_477N20151208S0272
tmpfile4367_477N20151208S0273
tmpfile4367_477N20151208S0274
tmpfile4367_477N20151208S0275
tmpfile4367_477N20151208S0276

GIREDUCE: Image tmpfile4367_477N20151208S0272 overscan subtracted
GIREDUCE: Image tmpfile4367_477N20151208S0273 overscan subtracted
GIREDUCE: Image tmpfile4367_477N20151208S0274 overscan subtracted
GIREDUCE: Image tmpfile4367_477N20151208S0275 overscan subtracted
GIREDUCE: Image tmpfile4367_477N20151208S0276 overscan subtracted
GIREDUCE: Image tmpfile4367_477N20151208S0272 trimmed
GIREDUCE: Image tmpfile4367_477N20151208S0273 trimmed
GIREDUCE: Image tmpfile4367_477N20151208S0274 trimmed
GIREDUCE: Image tmpfile4367_477N20151208S0275 trimmed
GIREDUCE: Image tmpfile4367_477N20151208S0276 trimmed


GIREDUCE - Cleaning up -- Sat Apr  9 12:13:05 HST 2016

GIREDUCE -- Sat Apr  9 12:13:05 HST 2016
GIREDUCE exit status:  good.
----------------------------------------------------------------------------
--------------------------------------------------------------------------------
GEMCOMBINE -- Sat Apr  9 12:13:05 HST 2016
 
GEMCOMBINE: input = @tmpcombin4367_474
GEMCOMBINE: output = N20151208S0272_bias.fits
GEMCOMBINE: title = Bias
GEMCOMBINE: bpmfile = 
GEMCOMBINE: sci_ext = SCI
GEMCOMBINE: var_ext = VAR
GEMCOMBINE: dq_ext = DQ
 
WARNING - GEMCOMBINE: five or less images to combine.

Apr  9 12:13: IMCOMBINE
  combine = average, scale = none, zero = none, weight = none
  reject = avsigclip, mclip = yes, nkeep = 1
  lsigma = 3., hsigma = 3.
  blank = 0.
  statsec = Apr  9 12:13
                Images     Exp
  tmpfile4367_477N20151208S0272.fits[SCI,1]    0.0
  tmpfile4367_477N20151208S0273.fits[SCI,1]    0.0
  tmpfile4367_477N20151208S0274.fits[SCI,1]    0.0
  tmpfile4367_477N20151208S0275.fits[SCI,1]    0.0
  tmpfile4367_477N20151208S0276.fits[SCI,1]    0.0

  Output image = tmpcombout4367_542, ncombine = 5
  Number rejected mask = tmpcombdq4367_543.pl
  Sigma image = tmpcombsig4367_544
WARNING - GEMCOMBINE: five or less images to combine.

Apr  9 12:13: IMCOMBINE
  combine = average, scale = none, zero = none, weight = none
  reject = avsigclip, mclip = yes, nkeep = 1
  lsigma = 3., hsigma = 3.
  blank = 0.
  statsec = Apr  9 12:13
                Images     Exp
  tmpfile4367_477N20151208S0272.fits[SCI,2]    0.0
  tmpfile4367_477N20151208S0273.fits[SCI,2]    0.0
  tmpfile4367_477N20151208S0274.fits[SCI,2]    0.0
  tmpfile4367_477N20151208S0275.fits[SCI,2]    0.0
  tmpfile4367_477N20151208S0276.fits[SCI,2]    0.0

  Output image = tmpcombout4367_549, ncombine = 5
  Number rejected mask = tmpcombdq4367_550.pl
  Sigma image = tmpcombsig4367_551
WARNING - GEMCOMBINE: five or less images to combine.

Apr  9 12:13: IMCOMBINE
  combine = average, scale = none, zero = none, weight = none
  reject = avsigclip, mclip = yes, nkeep = 1
  lsigma = 3., hsigma = 3.
  blank = 0.
  statsec = Apr  9 12:13
                Images     Exp
  tmpfile4367_477N20151208S0272.fits[SCI,3]    0.0
  tmpfile4367_477N20151208S0273.fits[SCI,3]    0.0
  tmpfile4367_477N20151208S0274.fits[SCI,3]    0.0
  tmpfile4367_477N20151208S0275.fits[SCI,3]    0.0
  tmpfile4367_477N20151208S0276.fits[SCI,3]    0.0

  Output image = tmpcombout4367_553, ncombine = 5
  Number rejected mask = tmpcombdq4367_554.pl
  Sigma image = tmpcombsig4367_555
WARNING - GEMCOMBINE: five or less images to combine.

Apr  9 12:13: IMCOMBINE
  combine = average, scale = none, zero = none, weight = none
  reject = avsigclip, mclip = yes, nkeep = 1
  lsigma = 3., hsigma = 3.
  blank = 0.
  statsec = Apr  9 12:13
                Images     Exp
  tmpfile4367_477N20151208S0272.fits[SCI,4]    0.0
  tmpfile4367_477N20151208S0273.fits[SCI,4]    0.0
  tmpfile4367_477N20151208S0274.fits[SCI,4]    0.0
  tmpfile4367_477N20151208S0275.fits[SCI,4]    0.0
  tmpfile4367_477N20151208S0276.fits[SCI,4]    0.0

  Output image = tmpcombout4367_557, ncombine = 5
  Number rejected mask = tmpcombdq4367_558.pl
  Sigma image = tmpcombsig4367_559
WARNING - GEMCOMBINE: five or less images to combine.

Apr  9 12:13: IMCOMBINE
  combine = average, scale = none, zero = none, weight = none
  reject = avsigclip, mclip = yes, nkeep = 1
  lsigma = 3., hsigma = 3.
  blank = 0.
  statsec = Apr  9 12:13
                Images     Exp
  tmpfile4367_477N20151208S0272.fits[SCI,5]    0.0
  tmpfile4367_477N20151208S0273.fits[SCI,5]    0.0
  tmpfile4367_477N20151208S0274.fits[SCI,5]    0.0
  tmpfile4367_477N20151208S0275.fits[SCI,5]    0.0
  tmpfile4367_477N20151208S0276.fits[SCI,5]    0.0

  Output image = tmpcombout4367_561, ncombine = 5
  Number rejected mask = tmpcombdq4367_562.pl
  Sigma image = tmpcombsig4367_563
WARNING - GEMCOMBINE: five or less images to combine.

Apr  9 12:13: IMCOMBINE
  combine = average, scale = none, zero = none, weight = none
  reject = avsigclip, mclip = yes, nkeep = 1
  lsigma = 3., hsigma = 3.
  blank = 0.
  statsec = Apr  9 12:13
                Images     Exp
  tmpfile4367_477N20151208S0272.fits[SCI,6]    0.0
  tmpfile4367_477N20151208S0273.fits[SCI,6]    0.0
  tmpfile4367_477N20151208S0274.fits[SCI,6]    0.0
  tmpfile4367_477N20151208S0275.fits[SCI,6]    0.0
  tmpfile4367_477N20151208S0276.fits[SCI,6]    0.0

  Output image = tmpcombout4367_565, ncombine = 5
  Number rejected mask = tmpcombdq4367_566.pl
  Sigma image = tmpcombsig4367_567
 
GEMCOMBINE -- Finished: Sat Apr  9 12:13:17 HST 2016
 
GEMCOMBINE -- Exit status: GOOD
--------------------------------------------------------------------------------

GBIAS: Exit status: GOOD.
----------------------------------------------------------------------------
Creating bias  N20151214S0346_bias.fits
----------------------------------------------------------------------------
GBIAS -- Sat Apr  9 12:13:17 HST 2016

Input images:
  N20151214S0346
  N20151214S0347
  N20151214S0348
  N20151214S0349
  N20151214S0350

Output bias image: N20151214S0346_bias.fits
 

----------------------------------------------------------------------------
GIREDUCE -- Sat Apr  9 12:13:18 HST 2016

----------------------------------------------------------------------------
GPREPARE -- Sat Apr  9 12:13:18 HST 2016

Input list    = /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151214S0346
Output list   = 
Output prefix = g
Raw path      = 
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151214S0346.fits   Output  gN20151214S0346.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Sat Apr  9 12:13:19 HST 2016

Input list    = /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151214S0347
Output list   = 
Output prefix = g
Raw path      = 
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151214S0347.fits   Output  gN20151214S0347.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Sat Apr  9 12:13:20 HST 2016

Input list    = /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151214S0348
Output list   = 
Output prefix = g
Raw path      = 
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151214S0348.fits   Output  gN20151214S0348.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Sat Apr  9 12:13:22 HST 2016

Input list    = /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151214S0349
Output list   = 
Output prefix = g
Raw path      = 
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151214S0349.fits   Output  gN20151214S0349.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Sat Apr  9 12:13:23 HST 2016

Input list    = /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151214S0350
Output list   = 
Output prefix = g
Raw path      = 
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151214S0350.fits   Output  gN20151214S0350.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------

Input files:
gN20151214S0346
gN20151214S0347
gN20151214S0348
gN20151214S0349
gN20151214S0350

Output files:
tmpfile4367_575N20151214S0346
tmpfile4367_575N20151214S0347
tmpfile4367_575N20151214S0348
tmpfile4367_575N20151214S0349
tmpfile4367_575N20151214S0350

GIREDUCE: Image tmpfile4367_575N20151214S0346 overscan subtracted
GIREDUCE: Image tmpfile4367_575N20151214S0347 overscan subtracted
GIREDUCE: Image tmpfile4367_575N20151214S0348 overscan subtracted
GIREDUCE: Image tmpfile4367_575N20151214S0349 overscan subtracted
GIREDUCE: Image tmpfile4367_575N20151214S0350 overscan subtracted
GIREDUCE: Image tmpfile4367_575N20151214S0346 trimmed
GIREDUCE: Image tmpfile4367_575N20151214S0347 trimmed
GIREDUCE: Image tmpfile4367_575N20151214S0348 trimmed
GIREDUCE: Image tmpfile4367_575N20151214S0349 trimmed
GIREDUCE: Image tmpfile4367_575N20151214S0350 trimmed


GIREDUCE - Cleaning up -- Sat Apr  9 12:14:12 HST 2016

GIREDUCE -- Sat Apr  9 12:14:12 HST 2016
GIREDUCE exit status:  good.
----------------------------------------------------------------------------
--------------------------------------------------------------------------------
GEMCOMBINE -- Sat Apr  9 12:14:12 HST 2016
 
GEMCOMBINE: input = @tmpcombin4367_572
GEMCOMBINE: output = N20151214S0346_bias.fits
GEMCOMBINE: title = Bias
GEMCOMBINE: bpmfile = 
GEMCOMBINE: sci_ext = SCI
GEMCOMBINE: var_ext = VAR
GEMCOMBINE: dq_ext = DQ
 
WARNING - GEMCOMBINE: five or less images to combine.

Apr  9 12:14: IMCOMBINE
  combine = average, scale = none, zero = none, weight = none
  reject = avsigclip, mclip = yes, nkeep = 1
  lsigma = 3., hsigma = 3.
  blank = 0.
  statsec = Apr  9 12:14
                Images     Exp
  tmpfile4367_575N20151214S0346.fits[SCI,1]    0.0
  tmpfile4367_575N20151214S0347.fits[SCI,1]    0.0
  tmpfile4367_575N20151214S0348.fits[SCI,1]    0.0
  tmpfile4367_575N20151214S0349.fits[SCI,1]    0.0
  tmpfile4367_575N20151214S0350.fits[SCI,1]    0.0

  Output image = tmpcombout4367_640, ncombine = 5
  Number rejected mask = tmpcombdq4367_641.pl
  Sigma image = tmpcombsig4367_642
WARNING - GEMCOMBINE: five or less images to combine.

Apr  9 12:14: IMCOMBINE
  combine = average, scale = none, zero = none, weight = none
  reject = avsigclip, mclip = yes, nkeep = 1
  lsigma = 3., hsigma = 3.
  blank = 0.
  statsec = Apr  9 12:14
                Images     Exp
  tmpfile4367_575N20151214S0346.fits[SCI,2]    0.0
  tmpfile4367_575N20151214S0347.fits[SCI,2]    0.0
  tmpfile4367_575N20151214S0348.fits[SCI,2]    0.0
  tmpfile4367_575N20151214S0349.fits[SCI,2]    0.0
  tmpfile4367_575N20151214S0350.fits[SCI,2]    0.0

  Output image = tmpcombout4367_647, ncombine = 5
  Number rejected mask = tmpcombdq4367_648.pl
  Sigma image = tmpcombsig4367_649
WARNING - GEMCOMBINE: five or less images to combine.

Apr  9 12:14: IMCOMBINE
  combine = average, scale = none, zero = none, weight = none
  reject = avsigclip, mclip = yes, nkeep = 1
  lsigma = 3., hsigma = 3.
  blank = 0.
  statsec = Apr  9 12:14
                Images     Exp
  tmpfile4367_575N20151214S0346.fits[SCI,3]    0.0
  tmpfile4367_575N20151214S0347.fits[SCI,3]    0.0
  tmpfile4367_575N20151214S0348.fits[SCI,3]    0.0
  tmpfile4367_575N20151214S0349.fits[SCI,3]    0.0
  tmpfile4367_575N20151214S0350.fits[SCI,3]    0.0

  Output image = tmpcombout4367_651, ncombine = 5
  Number rejected mask = tmpcombdq4367_652.pl
  Sigma image = tmpcombsig4367_653
WARNING - GEMCOMBINE: five or less images to combine.

Apr  9 12:14: IMCOMBINE
  combine = average, scale = none, zero = none, weight = none
  reject = avsigclip, mclip = yes, nkeep = 1
  lsigma = 3., hsigma = 3.
  blank = 0.
  statsec = Apr  9 12:14
                Images     Exp
  tmpfile4367_575N20151214S0346.fits[SCI,4]    0.0
  tmpfile4367_575N20151214S0347.fits[SCI,4]    0.0
  tmpfile4367_575N20151214S0348.fits[SCI,4]    0.0
  tmpfile4367_575N20151214S0349.fits[SCI,4]    0.0
  tmpfile4367_575N20151214S0350.fits[SCI,4]    0.0

  Output image = tmpcombout4367_655, ncombine = 5
  Number rejected mask = tmpcombdq4367_656.pl
  Sigma image = tmpcombsig4367_657
WARNING - GEMCOMBINE: five or less images to combine.

Apr  9 12:14: IMCOMBINE
  combine = average, scale = none, zero = none, weight = none
  reject = avsigclip, mclip = yes, nkeep = 1
  lsigma = 3., hsigma = 3.
  blank = 0.
  statsec = Apr  9 12:14
                Images     Exp
  tmpfile4367_575N20151214S0346.fits[SCI,5]    0.0
  tmpfile4367_575N20151214S0347.fits[SCI,5]    0.0
  tmpfile4367_575N20151214S0348.fits[SCI,5]    0.0
  tmpfile4367_575N20151214S0349.fits[SCI,5]    0.0
  tmpfile4367_575N20151214S0350.fits[SCI,5]    0.0

  Output image = tmpcombout4367_659, ncombine = 5
  Number rejected mask = tmpcombdq4367_660.pl
  Sigma image = tmpcombsig4367_661
WARNING - GEMCOMBINE: five or less images to combine.

Apr  9 12:14: IMCOMBINE
  combine = average, scale = none, zero = none, weight = none
  reject = avsigclip, mclip = yes, nkeep = 1
  lsigma = 3., hsigma = 3.
  blank = 0.
  statsec = Apr  9 12:14
                Images     Exp
  tmpfile4367_575N20151214S0346.fits[SCI,6]    0.0
  tmpfile4367_575N20151214S0347.fits[SCI,6]    0.0
  tmpfile4367_575N20151214S0348.fits[SCI,6]    0.0
  tmpfile4367_575N20151214S0349.fits[SCI,6]    0.0
  tmpfile4367_575N20151214S0350.fits[SCI,6]    0.0

  Output image = tmpcombout4367_663, ncombine = 5
  Number rejected mask = tmpcombdq4367_664.pl
  Sigma image = tmpcombsig4367_665
 
GEMCOMBINE -- Finished: Sat Apr  9 12:14:24 HST 2016
 
GEMCOMBINE -- Exit status: GOOD
--------------------------------------------------------------------------------

GBIAS: Exit status: GOOD.
----------------------------------------------------------------------------
Out[5]:
['N20151205S0525_bias.fits',
 'N20151208S0272_bias.fits',
 'N20151214S0346_bias.fits']

Visually inspect the processed biases


In [6]:
# WARNING: interactive.  It launches imexam.  Type 'q' to quit.
for biaskey in biases.keys():
    iraf.gdisplay(biases[biaskey]['procbias'], 1, fl_paste='yes')


GDISPLAY - Started: 2016-04-09T12:14:46

GDISPLAY: Temporary image name tmpout4367_668N20151208S0272_bias.fits

GMULTIAMP - Started: 2016-04-09T12:14:46

GMULTIAMP: Tiling image...
               Image tiled.

GMULTIAMP - Finished: 2016-04-09T12:14:48
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY: Starting imexamine - quit with q

GDISPLAY - Finished: 2016-04-09T12:14:54


GDISPLAY - Started: 2016-04-09T12:14:54

GDISPLAY: Temporary image name tmpout4367_702N20151214S0346_bias.fits

GMULTIAMP - Started: 2016-04-09T12:14:54

GMULTIAMP: Tiling image...
               Image tiled.

GMULTIAMP - Finished: 2016-04-09T12:14:56
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY: Starting imexamine - quit with q

GDISPLAY - Finished: 2016-04-09T12:14:58

STEP 5: Process the twilight flats

This will produce the one twilight flat defined above. That flat will be used later to process the science frames and the fringe frames.


In [7]:
os.chdir(redux_path)

for flatkey in flats.keys():
    iraf.imdelete('g//@'+flatkey+'.lis', verify='no')
    iraf.imdelete('rg//@'+flatkey+'.lis', verify='no')
    
    flatlist = flatkey+'.lis'
    procbias = os.path.join(procbias_path, flats[flatkey]['flatbias'])
    
    print 'Processing raw twilight flats'
    
    # gprepare and bias correct the raw flats
    iraf.gireduce('@'+flatlist, rawpath=raw_path, \
                  fl_over='yes', fl_trim='yes', \
                  fl_bias='yes', bias=procbias, fl_flat='no', \
                  fl_vardq='yes')


Processing raw twilight flats
----------------------------------------------------------------------------
GIREDUCE -- Sat Apr  9 12:15:07 HST 2016

----------------------------------------------------------------------------
GPREPARE -- Sat Apr  9 12:15:07 HST 2016

Input list    = N20151208S0225
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/NGC3310/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151208S0225.fits   Output  gN20151208S0225.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Sat Apr  9 12:15:08 HST 2016

Input list    = N20151208S0226
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/NGC3310/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151208S0226.fits   Output  gN20151208S0226.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Sat Apr  9 12:15:09 HST 2016

Input list    = N20151208S0227
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/NGC3310/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151208S0227.fits   Output  gN20151208S0227.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Sat Apr  9 12:15:11 HST 2016

Input list    = N20151208S0228
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/NGC3310/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151208S0228.fits   Output  gN20151208S0228.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Sat Apr  9 12:15:12 HST 2016

Input list    = N20151208S0229
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/NGC3310/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151208S0229.fits   Output  gN20151208S0229.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Sat Apr  9 12:15:13 HST 2016

Input list    = N20151208S0230
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/NGC3310/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151208S0230.fits   Output  gN20151208S0230.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Sat Apr  9 12:15:15 HST 2016

Input list    = N20151208S0231
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/NGC3310/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151208S0231.fits   Output  gN20151208S0231.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Sat Apr  9 12:15:16 HST 2016

Input list    = N20151208S0232
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/NGC3310/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151208S0232.fits   Output  gN20151208S0232.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Sat Apr  9 12:15:18 HST 2016

Input list    = N20151208S0233
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/NGC3310/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151208S0233.fits   Output  gN20151208S0233.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------

Input files:
gN20151208S0225
gN20151208S0226
gN20151208S0227
gN20151208S0228
gN20151208S0229
gN20151208S0230
gN20151208S0231
gN20151208S0232
gN20151208S0233

Output files:
rgN20151208S0225
rgN20151208S0226
rgN20151208S0227
rgN20151208S0228
rgN20151208S0229
rgN20151208S0230
rgN20151208S0231
rgN20151208S0232
rgN20151208S0233

WARNING - GIREDUCE: Bad Pixel Mask filename is an empty string
                    Only saturated pixels will be flagged
GIREDUCE: Image rgN20151208S0225 overscan subtracted
GIREDUCE: Image rgN20151208S0226 overscan subtracted
GIREDUCE: Image rgN20151208S0227 overscan subtracted
GIREDUCE: Image rgN20151208S0228 overscan subtracted
GIREDUCE: Image rgN20151208S0229 overscan subtracted
GIREDUCE: Image rgN20151208S0230 overscan subtracted
GIREDUCE: Image rgN20151208S0231 overscan subtracted
GIREDUCE: Image rgN20151208S0232 overscan subtracted
GIREDUCE: Image rgN20151208S0233 overscan subtracted
GIREDUCE: Image rgN20151208S0225 trimmed
GIREDUCE: Image rgN20151208S0226 trimmed
GIREDUCE: Image rgN20151208S0227 trimmed
GIREDUCE: Image rgN20151208S0228 trimmed
GIREDUCE: Image rgN20151208S0229 trimmed
GIREDUCE: Image rgN20151208S0230 trimmed
GIREDUCE: Image rgN20151208S0231 trimmed
GIREDUCE: Image rgN20151208S0232 trimmed
GIREDUCE: Image rgN20151208S0233 trimmed

Output image       Bias                 Flat               Dark       Scale 
rgN20151208S0225   /data/workspace/DRWorkshopAAO/NGC3310/calib/bias/N20151208S0272_bias INDEF              INDEF       0.00
GIREDUCE: Subtracted bias /data/workspace/DRWorkshopAAO/NGC3310/calib/bias/N20151208S0272_bias from rgN20151208S0225
GIREDUCE: multiplying image rgN20151208S0225 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgN20151208S0226   /data/workspace/DRWorkshopAAO/NGC3310/calib/bias/N20151208S0272_bias INDEF              INDEF       0.00
GIREDUCE: Subtracted bias /data/workspace/DRWorkshopAAO/NGC3310/calib/bias/N20151208S0272_bias from rgN20151208S0226
GIREDUCE: multiplying image rgN20151208S0226 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgN20151208S0227   /data/workspace/DRWorkshopAAO/NGC3310/calib/bias/N20151208S0272_bias INDEF              INDEF       0.00
GIREDUCE: Subtracted bias /data/workspace/DRWorkshopAAO/NGC3310/calib/bias/N20151208S0272_bias from rgN20151208S0227
GIREDUCE: multiplying image rgN20151208S0227 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgN20151208S0228   /data/workspace/DRWorkshopAAO/NGC3310/calib/bias/N20151208S0272_bias INDEF              INDEF       0.00
GIREDUCE: Subtracted bias /data/workspace/DRWorkshopAAO/NGC3310/calib/bias/N20151208S0272_bias from rgN20151208S0228
GIREDUCE: multiplying image rgN20151208S0228 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgN20151208S0229   /data/workspace/DRWorkshopAAO/NGC3310/calib/bias/N20151208S0272_bias INDEF              INDEF       0.00
GIREDUCE: Subtracted bias /data/workspace/DRWorkshopAAO/NGC3310/calib/bias/N20151208S0272_bias from rgN20151208S0229
GIREDUCE: multiplying image rgN20151208S0229 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgN20151208S0230   /data/workspace/DRWorkshopAAO/NGC3310/calib/bias/N20151208S0272_bias INDEF              INDEF       0.00
GIREDUCE: Subtracted bias /data/workspace/DRWorkshopAAO/NGC3310/calib/bias/N20151208S0272_bias from rgN20151208S0230
GIREDUCE: multiplying image rgN20151208S0230 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgN20151208S0231   /data/workspace/DRWorkshopAAO/NGC3310/calib/bias/N20151208S0272_bias INDEF              INDEF       0.00
GIREDUCE: Subtracted bias /data/workspace/DRWorkshopAAO/NGC3310/calib/bias/N20151208S0272_bias from rgN20151208S0231
GIREDUCE: multiplying image rgN20151208S0231 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgN20151208S0232   /data/workspace/DRWorkshopAAO/NGC3310/calib/bias/N20151208S0272_bias INDEF              INDEF       0.00
GIREDUCE: Subtracted bias /data/workspace/DRWorkshopAAO/NGC3310/calib/bias/N20151208S0272_bias from rgN20151208S0232
GIREDUCE: multiplying image rgN20151208S0232 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgN20151208S0233   /data/workspace/DRWorkshopAAO/NGC3310/calib/bias/N20151208S0272_bias INDEF              INDEF       0.00
GIREDUCE: Subtracted bias /data/workspace/DRWorkshopAAO/NGC3310/calib/bias/N20151208S0272_bias from rgN20151208S0233
GIREDUCE: multiplying image rgN20151208S0233 by gain
GIREDUCE: output counts in electrons

GIREDUCE - Cleaning up -- Sat Apr  9 12:18:37 HST 2016

GIREDUCE -- Sat Apr  9 12:18:37 HST 2016
GIREDUCE exit status:  good.
----------------------------------------------------------------------------

In [8]:
os.chdir(redux_path)

for flatkey in flats.keys():
    iraf.imdelete(flats[flatkey]['procflat'], verify='no')
    
    flatlist = flatkey+'.lis'
    procflat = flats[flatkey]['procflat']
    
    print 'Creating twilight flat ', procflat
    
    # Create the processed flat
    iraf.giflat('rg//@'+flatlist, outflat=procflat, fl_vardq='yes')
    
    # Copy the processed flat to the calibration directory
    shutil.copy(procflat, procflat_path)

# The processed flats are:
os.listdir(procflat_path)


Creating twilight flat  N20151208S0225_flat_r.fits
----------------------------------------------------------------------------
GIFLAT -- Sat Apr  9 14:03:18 HST 2016
 
Flat field images = rg//@flat_20151208.lis
Output flat field image = N20151208S0225_flat_r.fits
 
WARNING - GIFLAT: using previously gireduce'd image: rgN20151208S0225
WARNING - GIFLAT: using previously gireduce'd image: rgN20151208S0226
WARNING - GIFLAT: using previously gireduce'd image: rgN20151208S0227
WARNING - GIFLAT: using previously gireduce'd image: rgN20151208S0228
WARNING - GIFLAT: using previously gireduce'd image: rgN20151208S0229
WARNING - GIFLAT: using previously gireduce'd image: rgN20151208S0230
WARNING - GIFLAT: using previously gireduce'd image: rgN20151208S0231
WARNING - GIFLAT: using previously gireduce'd image: rgN20151208S0232
WARNING - GIFLAT: using previously gireduce'd image: rgN20151208S0233
Using input files:
rgN20151208S0225
rgN20151208S0226
rgN20151208S0227
rgN20151208S0228
rgN20151208S0229
rgN20151208S0230
rgN20151208S0231
rgN20151208S0232
rgN20151208S0233
Using STATSEC: [50:900,50:2250] from CCD2
Using NORMSEC: [50:900,50:2250] from CCD2
GIFLAT: Normalization factor 47136.13

GIFLAT exit status: good.
----------------------------------------------------------------------------
Out[8]:
['N20151205S0018_flat_g.fits', 'N20151208S0225_flat_r.fits']

Visually inspect the processed twilight flats


In [9]:
for flatkey in flats.keys():
    iraf.gdisplay(flats[flatkey]['procflat'], 1, fl_paste='yes')


GDISPLAY - Started: 2016-04-09T14:03:58

GDISPLAY: Temporary image name tmpout4367_1147N20151208S0225_flat_r.fits

GMULTIAMP - Started: 2016-04-09T14:03:58

GMULTIAMP: Tiling image...
               Image tiled.

GMULTIAMP - Finished: 2016-04-09T14:04:00
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY: Starting imexamine - quit with q

GDISPLAY - Finished: 2016-04-09T14:04:08

STEP 6: Process the fringe frame

STEP 7: Process the target

There is no significant fringing in the r-band. No extra fringing correction will be necessary. If you do want to learn about how to correct for fringing, see the i-band notebook.

All we need to do here is the straighforward processing, i.e. the bias and flat correction. (And overscan and trim.)

STEP 7.1: Bias and flat fielding of the target


In [10]:
os.chdir(redux_path)

iraf.imdelete('g//@sci.lis', verify='no')
iraf.imdelete('rg//@sci.lis', verify='no')

iraf.gireduce('@sci.lis', rawpath=raw_path, fl_over='yes', fl_trim='yes', \
              fl_bias='yes', bias=science['scibias'], \
              fl_flat='yes', flat1=science['sciflat'], \
              fl_vardq='yes')


----------------------------------------------------------------------------
GIREDUCE -- Sat Apr  9 14:04:18 HST 2016

----------------------------------------------------------------------------
GPREPARE -- Sat Apr  9 14:04:18 HST 2016

Input list    = N20151214S0243
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/NGC3310/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151214S0243.fits   Output  gN20151214S0243.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Sat Apr  9 14:04:19 HST 2016

Input list    = N20151214S0244
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/NGC3310/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151214S0244.fits   Output  gN20151214S0244.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Sat Apr  9 14:04:20 HST 2016

Input list    = N20151214S0245
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/NGC3310/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151214S0245.fits   Output  gN20151214S0245.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Sat Apr  9 14:04:22 HST 2016

Input list    = N20151214S0246
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/NGC3310/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/NGC3310/raw/N20151214S0246.fits   Output  gN20151214S0246.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------

Input files:
gN20151214S0243
gN20151214S0244
gN20151214S0245
gN20151214S0246

Output files:
rgN20151214S0243
rgN20151214S0244
rgN20151214S0245
rgN20151214S0246

WARNING - GIREDUCE: Bad Pixel Mask filename is an empty string
                    Only saturated pixels will be flagged
GIREDUCE: Image rgN20151214S0243 overscan subtracted
GIREDUCE: Image rgN20151214S0244 overscan subtracted
GIREDUCE: Image rgN20151214S0245 overscan subtracted
GIREDUCE: Image rgN20151214S0246 overscan subtracted
GIREDUCE: Image rgN20151214S0243 trimmed
GIREDUCE: Image rgN20151214S0244 trimmed
GIREDUCE: Image rgN20151214S0245 trimmed
GIREDUCE: Image rgN20151214S0246 trimmed

Output image       Bias                 Flat               Dark       Scale 
rgN20151214S0243   N20151214S0346_bias  N20151208S0225_flat_r INDEF       0.00
GIREDUCE: Subtracted bias N20151214S0346_bias from rgN20151214S0243
GIREDUCE: Divided image rgN20151214S0243 by flatfield N20151208S0225_flat_r
GIREDUCE: multiplying image rgN20151214S0243 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgN20151214S0244   N20151214S0346_bias  N20151208S0225_flat_r INDEF       0.00
GIREDUCE: Subtracted bias N20151214S0346_bias from rgN20151214S0244
GIREDUCE: Divided image rgN20151214S0244 by flatfield N20151208S0225_flat_r
GIREDUCE: multiplying image rgN20151214S0244 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgN20151214S0245   N20151214S0346_bias  N20151208S0225_flat_r INDEF       0.00
GIREDUCE: Subtracted bias N20151214S0346_bias from rgN20151214S0245
GIREDUCE: Divided image rgN20151214S0245 by flatfield N20151208S0225_flat_r
GIREDUCE: multiplying image rgN20151214S0245 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgN20151214S0246   N20151214S0346_bias  N20151208S0225_flat_r INDEF       0.00
GIREDUCE: Subtracted bias N20151214S0346_bias from rgN20151214S0246
GIREDUCE: Divided image rgN20151214S0246 by flatfield N20151208S0225_flat_r
GIREDUCE: multiplying image rgN20151214S0246 by gain
GIREDUCE: output counts in electrons

GIREDUCE - Cleaning up -- Sat Apr  9 14:05:58 HST 2016

GIREDUCE -- Sat Apr  9 14:05:58 HST 2016
GIREDUCE exit status:  good.
----------------------------------------------------------------------------

Visually inspect the reduce science frames


In [11]:
sciframes = open('sci.lis', 'r')
for line in sciframes:
    frame = line.strip()
    iraf.gdisplay('rg'+frame, 1, fl_paste='yes')
sciframes.close()


GDISPLAY - Started: 2016-04-09T14:06:20

GDISPLAY: Temporary image name tmpout4367_1275rgN20151214S0243.fits

GMULTIAMP - Started: 2016-04-09T14:06:20

GMULTIAMP: Tiling image...
               Image tiled.

GMULTIAMP - Finished: 2016-04-09T14:06:22
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY: Starting imexamine - quit with q

GDISPLAY - Finished: 2016-04-09T14:06:29


GDISPLAY - Started: 2016-04-09T14:06:29

GDISPLAY: Temporary image name tmpout4367_1309rgN20151214S0244.fits

GMULTIAMP - Started: 2016-04-09T14:06:30

GMULTIAMP: Tiling image...
               Image tiled.

GMULTIAMP - Finished: 2016-04-09T14:06:32
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY: Starting imexamine - quit with q

GDISPLAY - Finished: 2016-04-09T14:06:34


GDISPLAY - Started: 2016-04-09T14:06:34

GDISPLAY: Temporary image name tmpout4367_1343rgN20151214S0245.fits

GMULTIAMP - Started: 2016-04-09T14:06:34

GMULTIAMP: Tiling image...
               Image tiled.

GMULTIAMP - Finished: 2016-04-09T14:06:36
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY: Starting imexamine - quit with q

GDISPLAY - Finished: 2016-04-09T14:06:39


GDISPLAY - Started: 2016-04-09T14:06:39

GDISPLAY: Temporary image name tmpout4367_1377rgN20151214S0246.fits

GMULTIAMP - Started: 2016-04-09T14:06:39

GMULTIAMP: Tiling image...
               Image tiled.

GMULTIAMP - Finished: 2016-04-09T14:06:41
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY: Starting imexamine - quit with q

GDISPLAY - Finished: 2016-04-09T14:06:43

STEP 7.2: Fringe removal

STEP 8: Mosaic the reduced target frames


In [12]:
iraf.imdelete('mrg//@sci.lis', verify='no')

iraf.gmosaic('rg//@sci.lis', fl_vardq='yes')


GMOSAIC 
GMOSAIC -------------------------------------------------------------------
GMOSAIC Log opened at [Sat 14:06:55 09-Apr-2016]
GMOSAIC 
GMOSAIC --------------------
GMOSAIC Input Parameters:
GMOSAIC      inimages       = rg//@sci.lis
GMOSAIC      outimages      = 
GMOSAIC      outpref        = m
GMOSAIC      fl_paste       = no
GMOSAIC      fl_vardq       = yes
GMOSAIC      fl_fixpix      = no
GMOSAIC      fl_clean       = yes
GMOSAIC      fl_fulldq      = no
GMOSAIC      bitflags       = all
GMOSAIC      dqthresh       = 0.1
GMOSAIC      geointer       = linear
GMOSAIC      gap            = default
GMOSAIC      bpmfile        = gmos$data/chipgaps.dat
GMOSAIC      statsec        = default
GMOSAIC      obsmode        = IMAGE
GMOSAIC      sci_ext        = SCI
GMOSAIC      var_ext        = VAR
GMOSAIC      dq_ext         = DQ
GMOSAIC      key_detsec     = DETSEC
GMOSAIC      key_ccdsec     = CCDSEC
GMOSAIC      key_datsec     = DATASEC
GMOSAIC      key_ccdsum     = CCDSUM
GMOSAIC      key_obsmode    = OBSMODE
GMOSAIC      logfile        = 
GMOSAIC      verbose        = yes
GMOSAIC      fl_real        = no
GMOSAIC --------------------
GMOSAIC Input: rgN20151214S0243  Output: mrgN20151214S0243.fits
GMOSAIC imcopy  rgN20151214S0243[SCI,2][1:512,1:2304]  tmptile4367_1426[1,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0243[SCI,1][1:512,1:2304]  tmptile4367_1426[1,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0243[VAR,2][1:512,1:2304]  tmptile4367_1426[2,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0243[VAR,1][1:512,1:2304]  tmptile4367_1426[2,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0243[DQ,2][1:512,1:2304]  tmptile4367_1426[3,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0243[DQ,1][1:512,1:2304]  tmptile4367_1426[3,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0243[SCI,4][1:512,1:2304]  tmptile4367_1427[1,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0243[SCI,3][1:512,1:2304]  tmptile4367_1427[1,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0243[VAR,4][1:512,1:2304]  tmptile4367_1427[2,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0243[VAR,3][1:512,1:2304]  tmptile4367_1427[2,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0243[DQ,4][1:512,1:2304]  tmptile4367_1427[3,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0243[DQ,3][1:512,1:2304]  tmptile4367_1427[3,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0243[SCI,5][1:512,1:2304]  tmptile4367_1428[1,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0243[SCI,6][1:512,1:2304]  tmptile4367_1428[1,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0243[VAR,5][1:512,1:2304]  tmptile4367_1428[2,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0243[VAR,6][1:512,1:2304]  tmptile4367_1428[2,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0243[DQ,5][1:512,1:2304]  tmptile4367_1428[3,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0243[DQ,6][1:512,1:2304]  tmptile4367_1428[3,append][513:1024,1:2304]  INDEF  0.
GMOSAIC Setting rotation Xrot[1]=-0.009000, Yrot[1]=-0.009000
GMOSAIC Setting rotation Xrot[2]= 0.000000, Yrot[2]= 0.000000
GMOSAIC Setting rotation Xrot[3]=-0.003000, Yrot[3]=-0.003000
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1422[SCI,1][1:1024,1:2304] to image tmpchipsci4367_1429
GMOSAIC     xshift: 2.03 yshift: 0.29 xmag: 1.00 ymag: 1.00 xrot: 359.99 yrot: 359.99
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1422[VAR,1][1:1024,1:2304] to image tmpchipvar4367_1430
GMOSAIC     xshift: 2.03 yshift: 0.29 xmag: 1.00 ymag: 1.00 xrot: 359.99 yrot: 359.99
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1422[DQ,1][1:1024,1:2304] to image tmpdq_transimg4367_1418.fits
GMOSAIC     xshift: 2.03 yshift: 0.29 xmag: 1.00 ymag: 1.00 xrot: 359.99 yrot: 359.99
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1422[SCI,2][1:1024,1:2304] to image tmpchipsci4367_1432
GMOSAIC     xshift: 0.00 yshift: 0.00 xmag: 1.00 ymag: 1.00 xrot: 0.00 yrot: 0.00
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1422[VAR,2][1:1024,1:2304] to image tmpchipvar4367_1433
GMOSAIC     xshift: 0.00 yshift: 0.00 xmag: 1.00 ymag: 1.00 xrot: 0.00 yrot: 0.00
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1422[SCI,3][1:1024,1:2304] to image tmpchipsci4367_1435
GMOSAIC     xshift: -1.84 yshift: -1.05 xmag: 1.00 ymag: 1.00 xrot: 360.00 yrot: 360.00
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1422[VAR,3][1:1024,1:2304] to image tmpchipvar4367_1436
GMOSAIC     xshift: -1.84 yshift: -1.05 xmag: 1.00 ymag: 1.00 xrot: 360.00 yrot: 360.00
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1422[DQ,3][1:1024,1:2304] to image tmpdq_transimg4367_1418.fits
GMOSAIC     xshift: -1.84 yshift: -1.05 xmag: 1.00 ymag: 1.00 xrot: 360.00 yrot: 360.00
GMOSAIC imcopy  tmpchipsci4367_1429  mrgN20151214S0243.fits[1,append][1:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipsci4367_1432  mrgN20151214S0243.fits[1,append][1043:2066,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipsci4367_1435  mrgN20151214S0243.fits[1,append][2085:3108,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipvar4367_1430  mrgN20151214S0243.fits[2,append][1:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipvar4367_1433  mrgN20151214S0243.fits[2,append][1043:2066,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipvar4367_1436  mrgN20151214S0243.fits[2,append][2085:3108,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipdq4367_1431  mrgN20151214S0243.fits[3,append][1:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipdq4367_1434  mrgN20151214S0243.fits[3,append][1043:2066,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipdq4367_1437  mrgN20151214S0243.fits[3,append][2085:3108,1:2304]  INDEF  0.
gmos$data/gmos-n_bpm_e2v_22_6amp_v1_mosaic.pl
GMOSAIC Cleaning areas outside imaging field, cleaning value = 1866.788
GMOSAIC Input: rgN20151214S0244  Output: mrgN20151214S0244.fits
GMOSAIC imcopy  rgN20151214S0244[SCI,2][1:512,1:2304]  tmptile4367_1442[1,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0244[SCI,1][1:512,1:2304]  tmptile4367_1442[1,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0244[VAR,2][1:512,1:2304]  tmptile4367_1442[2,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0244[VAR,1][1:512,1:2304]  tmptile4367_1442[2,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0244[DQ,2][1:512,1:2304]  tmptile4367_1442[3,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0244[DQ,1][1:512,1:2304]  tmptile4367_1442[3,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0244[SCI,4][1:512,1:2304]  tmptile4367_1443[1,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0244[SCI,3][1:512,1:2304]  tmptile4367_1443[1,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0244[VAR,4][1:512,1:2304]  tmptile4367_1443[2,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0244[VAR,3][1:512,1:2304]  tmptile4367_1443[2,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0244[DQ,4][1:512,1:2304]  tmptile4367_1443[3,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0244[DQ,3][1:512,1:2304]  tmptile4367_1443[3,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0244[SCI,5][1:512,1:2304]  tmptile4367_1444[1,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0244[SCI,6][1:512,1:2304]  tmptile4367_1444[1,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0244[VAR,5][1:512,1:2304]  tmptile4367_1444[2,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0244[VAR,6][1:512,1:2304]  tmptile4367_1444[2,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0244[DQ,5][1:512,1:2304]  tmptile4367_1444[3,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0244[DQ,6][1:512,1:2304]  tmptile4367_1444[3,append][513:1024,1:2304]  INDEF  0.
GMOSAIC Setting rotation Xrot[1]=-0.009000, Yrot[1]=-0.009000
GMOSAIC Setting rotation Xrot[2]= 0.000000, Yrot[2]= 0.000000
GMOSAIC Setting rotation Xrot[3]=-0.003000, Yrot[3]=-0.003000
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1438[SCI,1][1:1024,1:2304] to image tmpchipsci4367_1445
GMOSAIC     xshift: 2.03 yshift: 0.29 xmag: 1.00 ymag: 1.00 xrot: 359.99 yrot: 359.99
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1438[VAR,1][1:1024,1:2304] to image tmpchipvar4367_1446
GMOSAIC     xshift: 2.03 yshift: 0.29 xmag: 1.00 ymag: 1.00 xrot: 359.99 yrot: 359.99
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1438[DQ,1][1:1024,1:2304] to image tmpdq_transimg4367_1418.fits
GMOSAIC     xshift: 2.03 yshift: 0.29 xmag: 1.00 ymag: 1.00 xrot: 359.99 yrot: 359.99
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1438[SCI,2][1:1024,1:2304] to image tmpchipsci4367_1448
GMOSAIC     xshift: 0.00 yshift: 0.00 xmag: 1.00 ymag: 1.00 xrot: 0.00 yrot: 0.00
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1438[VAR,2][1:1024,1:2304] to image tmpchipvar4367_1449
GMOSAIC     xshift: 0.00 yshift: 0.00 xmag: 1.00 ymag: 1.00 xrot: 0.00 yrot: 0.00
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1438[SCI,3][1:1024,1:2304] to image tmpchipsci4367_1451
GMOSAIC     xshift: -1.84 yshift: -1.05 xmag: 1.00 ymag: 1.00 xrot: 360.00 yrot: 360.00
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1438[VAR,3][1:1024,1:2304] to image tmpchipvar4367_1452
GMOSAIC     xshift: -1.84 yshift: -1.05 xmag: 1.00 ymag: 1.00 xrot: 360.00 yrot: 360.00
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1438[DQ,3][1:1024,1:2304] to image tmpdq_transimg4367_1418.fits
GMOSAIC     xshift: -1.84 yshift: -1.05 xmag: 1.00 ymag: 1.00 xrot: 360.00 yrot: 360.00
GMOSAIC imcopy  tmpchipsci4367_1445  mrgN20151214S0244.fits[1,append][1:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipsci4367_1448  mrgN20151214S0244.fits[1,append][1043:2066,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipsci4367_1451  mrgN20151214S0244.fits[1,append][2085:3108,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipvar4367_1446  mrgN20151214S0244.fits[2,append][1:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipvar4367_1449  mrgN20151214S0244.fits[2,append][1043:2066,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipvar4367_1452  mrgN20151214S0244.fits[2,append][2085:3108,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipdq4367_1447  mrgN20151214S0244.fits[3,append][1:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipdq4367_1450  mrgN20151214S0244.fits[3,append][1043:2066,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipdq4367_1453  mrgN20151214S0244.fits[3,append][2085:3108,1:2304]  INDEF  0.
gmos$data/gmos-n_bpm_e2v_22_6amp_v1_mosaic.pl
GMOSAIC Cleaning areas outside imaging field, cleaning value = 1841.313
GMOSAIC Input: rgN20151214S0245  Output: mrgN20151214S0245.fits
GMOSAIC imcopy  rgN20151214S0245[SCI,2][1:512,1:2304]  tmptile4367_1458[1,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0245[SCI,1][1:512,1:2304]  tmptile4367_1458[1,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0245[VAR,2][1:512,1:2304]  tmptile4367_1458[2,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0245[VAR,1][1:512,1:2304]  tmptile4367_1458[2,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0245[DQ,2][1:512,1:2304]  tmptile4367_1458[3,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0245[DQ,1][1:512,1:2304]  tmptile4367_1458[3,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0245[SCI,4][1:512,1:2304]  tmptile4367_1459[1,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0245[SCI,3][1:512,1:2304]  tmptile4367_1459[1,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0245[VAR,4][1:512,1:2304]  tmptile4367_1459[2,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0245[VAR,3][1:512,1:2304]  tmptile4367_1459[2,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0245[DQ,4][1:512,1:2304]  tmptile4367_1459[3,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0245[DQ,3][1:512,1:2304]  tmptile4367_1459[3,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0245[SCI,5][1:512,1:2304]  tmptile4367_1460[1,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0245[SCI,6][1:512,1:2304]  tmptile4367_1460[1,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0245[VAR,5][1:512,1:2304]  tmptile4367_1460[2,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0245[VAR,6][1:512,1:2304]  tmptile4367_1460[2,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0245[DQ,5][1:512,1:2304]  tmptile4367_1460[3,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0245[DQ,6][1:512,1:2304]  tmptile4367_1460[3,append][513:1024,1:2304]  INDEF  0.
GMOSAIC Setting rotation Xrot[1]=-0.009000, Yrot[1]=-0.009000
GMOSAIC Setting rotation Xrot[2]= 0.000000, Yrot[2]= 0.000000
GMOSAIC Setting rotation Xrot[3]=-0.003000, Yrot[3]=-0.003000
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1454[SCI,1][1:1024,1:2304] to image tmpchipsci4367_1461
GMOSAIC     xshift: 2.03 yshift: 0.29 xmag: 1.00 ymag: 1.00 xrot: 359.99 yrot: 359.99
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1454[VAR,1][1:1024,1:2304] to image tmpchipvar4367_1462
GMOSAIC     xshift: 2.03 yshift: 0.29 xmag: 1.00 ymag: 1.00 xrot: 359.99 yrot: 359.99
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1454[DQ,1][1:1024,1:2304] to image tmpdq_transimg4367_1418.fits
GMOSAIC     xshift: 2.03 yshift: 0.29 xmag: 1.00 ymag: 1.00 xrot: 359.99 yrot: 359.99
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1454[SCI,2][1:1024,1:2304] to image tmpchipsci4367_1464
GMOSAIC     xshift: 0.00 yshift: 0.00 xmag: 1.00 ymag: 1.00 xrot: 0.00 yrot: 0.00
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1454[VAR,2][1:1024,1:2304] to image tmpchipvar4367_1465
GMOSAIC     xshift: 0.00 yshift: 0.00 xmag: 1.00 ymag: 1.00 xrot: 0.00 yrot: 0.00
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1454[SCI,3][1:1024,1:2304] to image tmpchipsci4367_1467
GMOSAIC     xshift: -1.84 yshift: -1.05 xmag: 1.00 ymag: 1.00 xrot: 360.00 yrot: 360.00
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1454[VAR,3][1:1024,1:2304] to image tmpchipvar4367_1468
GMOSAIC     xshift: -1.84 yshift: -1.05 xmag: 1.00 ymag: 1.00 xrot: 360.00 yrot: 360.00
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1454[DQ,3][1:1024,1:2304] to image tmpdq_transimg4367_1418.fits
GMOSAIC     xshift: -1.84 yshift: -1.05 xmag: 1.00 ymag: 1.00 xrot: 360.00 yrot: 360.00
GMOSAIC imcopy  tmpchipsci4367_1461  mrgN20151214S0245.fits[1,append][1:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipsci4367_1464  mrgN20151214S0245.fits[1,append][1043:2066,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipsci4367_1467  mrgN20151214S0245.fits[1,append][2085:3108,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipvar4367_1462  mrgN20151214S0245.fits[2,append][1:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipvar4367_1465  mrgN20151214S0245.fits[2,append][1043:2066,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipvar4367_1468  mrgN20151214S0245.fits[2,append][2085:3108,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipdq4367_1463  mrgN20151214S0245.fits[3,append][1:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipdq4367_1466  mrgN20151214S0245.fits[3,append][1043:2066,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipdq4367_1469  mrgN20151214S0245.fits[3,append][2085:3108,1:2304]  INDEF  0.
gmos$data/gmos-n_bpm_e2v_22_6amp_v1_mosaic.pl
GMOSAIC Cleaning areas outside imaging field, cleaning value = 1856.915
GMOSAIC Input: rgN20151214S0246  Output: mrgN20151214S0246.fits
GMOSAIC imcopy  rgN20151214S0246[SCI,2][1:512,1:2304]  tmptile4367_1474[1,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0246[SCI,1][1:512,1:2304]  tmptile4367_1474[1,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0246[VAR,2][1:512,1:2304]  tmptile4367_1474[2,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0246[VAR,1][1:512,1:2304]  tmptile4367_1474[2,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0246[DQ,2][1:512,1:2304]  tmptile4367_1474[3,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0246[DQ,1][1:512,1:2304]  tmptile4367_1474[3,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0246[SCI,4][1:512,1:2304]  tmptile4367_1475[1,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0246[SCI,3][1:512,1:2304]  tmptile4367_1475[1,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0246[VAR,4][1:512,1:2304]  tmptile4367_1475[2,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0246[VAR,3][1:512,1:2304]  tmptile4367_1475[2,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0246[DQ,4][1:512,1:2304]  tmptile4367_1475[3,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0246[DQ,3][1:512,1:2304]  tmptile4367_1475[3,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0246[SCI,5][1:512,1:2304]  tmptile4367_1476[1,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0246[SCI,6][1:512,1:2304]  tmptile4367_1476[1,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0246[VAR,5][1:512,1:2304]  tmptile4367_1476[2,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0246[VAR,6][1:512,1:2304]  tmptile4367_1476[2,append][513:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0246[DQ,5][1:512,1:2304]  tmptile4367_1476[3,append][1:512,1:2304]  INDEF  0.
GMOSAIC imcopy  rgN20151214S0246[DQ,6][1:512,1:2304]  tmptile4367_1476[3,append][513:1024,1:2304]  INDEF  0.
GMOSAIC Setting rotation Xrot[1]=-0.009000, Yrot[1]=-0.009000
GMOSAIC Setting rotation Xrot[2]= 0.000000, Yrot[2]= 0.000000
GMOSAIC Setting rotation Xrot[3]=-0.003000, Yrot[3]=-0.003000
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1470[SCI,1][1:1024,1:2304] to image tmpchipsci4367_1477
GMOSAIC     xshift: 2.03 yshift: 0.29 xmag: 1.00 ymag: 1.00 xrot: 359.99 yrot: 359.99
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1470[VAR,1][1:1024,1:2304] to image tmpchipvar4367_1478
GMOSAIC     xshift: 2.03 yshift: 0.29 xmag: 1.00 ymag: 1.00 xrot: 359.99 yrot: 359.99
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1470[DQ,1][1:1024,1:2304] to image tmpdq_transimg4367_1418.fits
GMOSAIC     xshift: 2.03 yshift: 0.29 xmag: 1.00 ymag: 1.00 xrot: 359.99 yrot: 359.99
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1470[SCI,2][1:1024,1:2304] to image tmpchipsci4367_1480
GMOSAIC     xshift: 0.00 yshift: 0.00 xmag: 1.00 ymag: 1.00 xrot: 0.00 yrot: 0.00
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1470[VAR,2][1:1024,1:2304] to image tmpchipvar4367_1481
GMOSAIC     xshift: 0.00 yshift: 0.00 xmag: 1.00 ymag: 1.00 xrot: 0.00 yrot: 0.00
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1470[SCI,3][1:1024,1:2304] to image tmpchipsci4367_1483
GMOSAIC     xshift: -1.84 yshift: -1.05 xmag: 1.00 ymag: 1.00 xrot: 360.00 yrot: 360.00
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1470[VAR,3][1:1024,1:2304] to image tmpchipvar4367_1484
GMOSAIC     xshift: -1.84 yshift: -1.05 xmag: 1.00 ymag: 1.00 xrot: 360.00 yrot: 360.00
GMOSAIC 
GMOSAIC Transforming image tmpimg4367_1470[DQ,3][1:1024,1:2304] to image tmpdq_transimg4367_1418.fits
GMOSAIC     xshift: -1.84 yshift: -1.05 xmag: 1.00 ymag: 1.00 xrot: 360.00 yrot: 360.00
GMOSAIC imcopy  tmpchipsci4367_1477  mrgN20151214S0246.fits[1,append][1:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipsci4367_1480  mrgN20151214S0246.fits[1,append][1043:2066,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipsci4367_1483  mrgN20151214S0246.fits[1,append][2085:3108,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipvar4367_1478  mrgN20151214S0246.fits[2,append][1:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipvar4367_1481  mrgN20151214S0246.fits[2,append][1043:2066,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipvar4367_1484  mrgN20151214S0246.fits[2,append][2085:3108,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipdq4367_1479  mrgN20151214S0246.fits[3,append][1:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipdq4367_1482  mrgN20151214S0246.fits[3,append][1043:2066,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipdq4367_1485  mrgN20151214S0246.fits[3,append][2085:3108,1:2304]  INDEF  0.
gmos$data/gmos-n_bpm_e2v_22_6amp_v1_mosaic.pl
GMOSAIC Cleaning areas outside imaging field, cleaning value = 1840.127
GMOSAIC All 4 images successfully mosaiced.
GMOSAIC --------------------
GMOSAIC Exit status: SUCCESS
GMOSAIC Log closed at [Sat 14:07:33 09-Apr-2016]
GMOSAIC -------------------------------------------------------------------
GMOSAIC 

Visually inspect the mosaiced frames


In [13]:
sciframes = open('sci.lis', 'r')
for line in sciframes:
    frame = line.strip()
    iraf.gdisplay('mrg'+frame, 1, z2=20000, fl_paste='yes')
sciframes.close()


GDISPLAY - Started: 2016-04-09T14:07:45

WARNING - GDISPLAY: only one science extension found, turning paste off

WARNING - GDISPLAY: Input image has been processed by GMOSAIC.
                    Switching off the following flags:
                          ret_roi=no

GDISPLAY: Displaying image...

GDISPLAY: Starting imexamine - quit with q

GDISPLAY - Finished: 2016-04-09T14:08:14


GDISPLAY - Started: 2016-04-09T14:08:14

WARNING - GDISPLAY: only one science extension found, turning paste off

WARNING - GDISPLAY: Input image has been processed by GMOSAIC.
                    Switching off the following flags:
                          ret_roi=no

GDISPLAY: Displaying image...

GDISPLAY: Starting imexamine - quit with q

GDISPLAY - Finished: 2016-04-09T14:08:16


GDISPLAY - Started: 2016-04-09T14:08:16

WARNING - GDISPLAY: only one science extension found, turning paste off

WARNING - GDISPLAY: Input image has been processed by GMOSAIC.
                    Switching off the following flags:
                          ret_roi=no

GDISPLAY: Displaying image...

GDISPLAY: Starting imexamine - quit with q

GDISPLAY - Finished: 2016-04-09T14:08:18


GDISPLAY - Started: 2016-04-09T14:08:18

WARNING - GDISPLAY: only one science extension found, turning paste off

WARNING - GDISPLAY: Input image has been processed by GMOSAIC.
                    Switching off the following flags:
                          ret_roi=no

GDISPLAY: Displaying image...

GDISPLAY: Starting imexamine - quit with q

GDISPLAY - Finished: 2016-04-09T14:08:19

STEP 9: Align and stack the mosaic target frames


In [14]:
iraf.imdelete(science['procsci'], verify='no')

iraf.imcoadd('mrg//@sci.lis', outimage=science['procsci'], logfile=logfile)


-----------------------------------------------------------------------------
IMCOADD -- Sat Apr  9 14:08:27 HST 2016

Images (and masks) in list
mrgN20151214S0243
mrgN20151214S0244
mrgN20151214S0245
mrgN20151214S0246
Alignment method: wcs
Making individual masks from DQ
Fixpix input images using DQ
Instrument + camera      : GMOS-N  
Telescope ISS port number: 5
Bad pixel file gmos$data/gmos-n_bpm_e2v_22_6amp_v1_mosaic.pl
Read noise:   3.20 e-   Gain:   1.00 e-/ADU
Co-added cleaned output image: ngc3310_r
Pixel scale: 0.1458
Statistics section: [100:3008,100:2204]
Finding objects in mrgN20151214S0243
Sampling for geotran  : 20  20
Block size for geotran: 2048  2048
Centering objects in mrgN20151214S0243
Number of objects successfully centered in reference image 549
Alignment method: wcs

Coordinate list: imxymatch.1  Transform: mrgN20151214S0244_trn
    Results file: 
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 0.001874259  0.00192745
Coordinate mapping parameters
    Mean Xref and Yref: 1554.5  1152.5
    Mean Xin and Yin: 1527.022  1111.345
    X and Y shift: -27.46937  -41.17017  (xin  yin)
    X and Y scale: 1.000001  1.000001  (xin / xref  yin / yref)
    X and Y axis rotation: 359.99948  359.99948  (degrees  degrees)
Centering objects in mrgN20151214S0244

Xmax =  3108   Ymax = 2304
Entering geomap
Fitting geometry rscale
Iterating a maximum of 5 times

Coordinate list: mrgN20151214S0244_trn  Transform: mrgN20151214S0244_trn
    Results file: tmpres4367_1507
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 13.44184  13.27067
Coordinate mapping parameters
    Mean Xref and Yref: 1639.738  1128.98
    Mean Xin and Yin: 1611.555  1086.482
    X and Y shift: -23.49515  -39.00928  (xin  yin)
    X and Y scale: 0.9979669  0.9979668  (xin / xref  yin / yref)
    X and Y axis rotation: 0.00282  0.00282  (degrees  degrees)

Coordinate list: mrgN20151214S0244_trn  Transform: mrgN20151214S0244_trn
    Results file: tmpres4367_1507
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 7.014241  7.369053
Coordinate mapping parameters
    Mean Xref and Yref: 1636.012  1121.472
    Mean Xin and Yin: 1609.249  1080.515
    X and Y shift: -27.59443  -39.59045  (xin  yin)
    X and Y scale: 0.9998904  0.9998905  (xin / xref  yin / yref)
    X and Y axis rotation: 0.03121  0.03121  (degrees  degrees)

Coordinate list: mrgN20151214S0244_trn  Transform: mrgN20151214S0244_trn
    Results file: tmpres4367_1507
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 1.118028  0.9397032
Coordinate mapping parameters
    Mean Xref and Yref: 1637.915  1139.974
    Mean Xin and Yin: 1610.783  1100.141
    X and Y shift: -27.77386  -40.15588  (xin  yin)
    X and Y scale: 1.000204  1.000204  (xin / xref  yin / yref)
    X and Y axis rotation: 0.00793  0.00793  (degrees  degrees)

Coordinate list: mrgN20151214S0244_trn  Transform: mrgN20151214S0244_trn
    Results file: tmpres4367_1507
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 0.1869404  0.1898964
Coordinate mapping parameters
    Mean Xref and Yref: 1651.939  1132.646
    Mean Xin and Yin: 1624.624  1092.365
    X and Y shift: -27.38398  -40.2926  (xin  yin)
    X and Y scale: 1.000026  1.000026  (xin / xref  yin / yref)
    X and Y axis rotation: 359.99973  359.99973  (degrees  degrees)

Coordinate list: mrgN20151214S0244_trn  Transform: mrgN20151214S0244_trn
    Results file: tmpres4367_1507
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 0.1641213  0.1472263
Coordinate mapping parameters
    Mean Xref and Yref: 1634.429  1157.46
    Mean Xin and Yin: 1607.083  1117.188
    X and Y shift: -27.39077  -40.30322  (xin  yin)
    X and Y scale: 1.000026  1.000026  (xin / xref  yin / yref)
    X and Y axis rotation: 0.00005  0.00005  (degrees  degrees)

Coordinate list: imxymatch.1  Transform: mrgN20151214S0245_trn
    Results file: 
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 0.001805345  0.001905333
Coordinate mapping parameters
    Mean Xref and Yref: 1554.5  1152.5
    Mean Xin and Yin: 1609.385  1152.457
    X and Y shift: 54.89504  -0.06115945  (xin  yin)
    X and Y scale: 1.000001  1.000001  (xin / xref  yin / yref)
    X and Y axis rotation: 359.99939  359.99939  (degrees  degrees)
Centering objects in mrgN20151214S0245

Xmax =  3108   Ymax = 2304
Entering geomap
Fitting geometry rscale
Iterating a maximum of 5 times

Coordinate list: mrgN20151214S0245_trn  Transform: mrgN20151214S0245_trn
    Results file: tmpres4367_1507
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 13.38424  12.40235
Coordinate mapping parameters
    Mean Xref and Yref: 1639.191  1121.35
    Mean Xin and Yin: 1666.542  1077.873
    X and Y shift: 32.74293  -39.28308  (xin  yin)
    X and Y scale: 0.9971321  0.9971322  (xin / xref  yin / yref)
    X and Y axis rotation: 359.98740  359.98740  (degrees  degrees)

Coordinate list: mrgN20151214S0245_trn  Transform: mrgN20151214S0245_trn
    Results file: tmpres4367_1507
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 7.488495  7.733632
Coordinate mapping parameters
    Mean Xref and Yref: 1636.661  1113.86
    Mean Xin and Yin: 1664.438  1072.292
    X and Y shift: 28.18962  -40.27576  (xin  yin)
    X and Y scale: 0.9993825  0.9993826  (xin / xref  yin / yref)
    X and Y axis rotation: 0.01822  0.01822  (degrees  degrees)

Coordinate list: mrgN20151214S0245_trn  Transform: mrgN20151214S0245_trn
    Results file: tmpres4367_1507
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 1.562556  1.318516
Coordinate mapping parameters
    Mean Xref and Yref: 1641.429  1123.187
    Mean Xin and Yin: 1669.126  1082.421
    X and Y shift: 27.64883  -41.01465  (xin  yin)
    X and Y scale: 0.9998833  0.9998833  (xin / xref  yin / yref)
    X and Y axis rotation: 359.98874  359.98874  (degrees  degrees)

Coordinate list: mrgN20151214S0245_trn  Transform: mrgN20151214S0245_trn
    Results file: tmpres4367_1507
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 0.1844243  0.2179789
Coordinate mapping parameters
    Mean Xref and Yref: 1650.45  1130.688
    Mean Xin and Yin: 1677.781  1089.79
    X and Y shift: 27.31703  -40.95459  (xin  yin)
    X and Y scale: 1.00004  1.00004  (xin / xref  yin / yref)
    X and Y axis rotation: 359.99881  359.99881  (degrees  degrees)

Coordinate list: mrgN20151214S0245_trn  Transform: mrgN20151214S0245_trn
    Results file: tmpres4367_1507
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 0.1283114  0.1744462
Coordinate mapping parameters
    Mean Xref and Yref: 1652.389  1144.376
    Mean Xin and Yin: 1679.741  1103.501
    X and Y shift: 27.26697  -40.99561  (xin  yin)
    X and Y scale: 1.000068  1.000067  (xin / xref  yin / yref)
    X and Y axis rotation: 359.99854  359.99854  (degrees  degrees)

Coordinate list: imxymatch.1  Transform: mrgN20151214S0246_trn
    Results file: 
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 0.001822514  0.001693809
Coordinate mapping parameters
    Mean Xref and Yref: 1554.5  1152.5
    Mean Xin and Yin: 1581.977  1193.655
    X and Y shift: 27.47207  41.15716  (xin  yin)
    X and Y scale: 1.000001  1.000001  (xin / xref  yin / yref)
    X and Y axis rotation: 0.00015  0.00015  (degrees  degrees)
Centering objects in mrgN20151214S0246

Xmax =  3108   Ymax = 2304
Entering geomap
Fitting geometry rscale
Iterating a maximum of 5 times

Coordinate list: mrgN20151214S0246_trn  Transform: mrgN20151214S0246_trn
    Results file: tmpres4367_1507
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 12.79669  12.53794
Coordinate mapping parameters
    Mean Xref and Yref: 1636.791  1122.01
    Mean Xin and Yin: 1691.55  1120.011
    X and Y shift: 61.7106  1.650513  (xin  yin)
    X and Y scale: 0.997003  0.997003  (xin / xref  yin / yref)
    X and Y axis rotation: 359.96048  359.96048  (degrees  degrees)

Coordinate list: mrgN20151214S0246_trn  Transform: mrgN20151214S0246_trn
    Results file: tmpres4367_1507
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 7.672786  7.999548
Coordinate mapping parameters
    Mean Xref and Yref: 1634.871  1110.179
    Mean Xin and Yin: 1690.47  1110.317
    X and Y shift: 57.04203  0.8813477  (xin  yin)
    X and Y scale: 0.9990864  0.9990864  (xin / xref  yin / yref)
    X and Y axis rotation: 359.99222  359.99222  (degrees  degrees)

Coordinate list: mrgN20151214S0246_trn  Transform: mrgN20151214S0246_trn
    Results file: tmpres4367_1507
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 1.500142  1.364747
Coordinate mapping parameters
    Mean Xref and Yref: 1638.076  1113.919
    Mean Xin and Yin: 1693.494  1114.714
    X and Y shift: 55.6192  0.4957275  (xin  yin)
    X and Y scale: 0.99981  0.99981  (xin / xref  yin / yref)
    X and Y axis rotation: 359.97818  359.97818  (degrees  degrees)

Coordinate list: mrgN20151214S0246_trn  Transform: mrgN20151214S0246_trn
    Results file: tmpres4367_1507
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 0.20955  0.1922102
Coordinate mapping parameters
    Mean Xref and Yref: 1651.037  1124.251
    Mean Xin and Yin: 1705.873  1125.131
    X and Y shift: 54.7019  0.7421875  (xin  yin)
    X and Y scale: 1.000092  1.000092  (xin / xref  yin / yref)
    X and Y axis rotation: 359.99850  359.99850  (degrees  degrees)

Coordinate list: mrgN20151214S0246_trn  Transform: mrgN20151214S0246_trn
    Results file: tmpres4367_1507
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 0.1524992  0.1447181
Coordinate mapping parameters
    Mean Xref and Yref: 1650.136  1112.146
    Mean Xin and Yin: 1704.959  1113.038
    X and Y shift: 54.68356  0.7381592  (xin  yin)
    X and Y scale: 1.000096  1.000096  (xin / xref  yin / yref)
    X and Y axis rotation: 359.99866  359.99866  (degrees  degrees)

Median sky level for mrgN20151214S0243:   1736.9
Transforming mrgN20151214S0244 to mrgN20151214S0244_trn

Transforming image mrgN20151214S0244[SCI] to image mrgN20151214S0244_trn
    Using transform mrgN20151214S0244_trn in database imcoadd.dat
Median sky level for mrgN20151214S0244:   1722.9
Transforming mrgN20151214S0245 to mrgN20151214S0245_trn

Transforming image mrgN20151214S0245[SCI] to image mrgN20151214S0245_trn
    Using transform mrgN20151214S0245_trn in database imcoadd.dat
Median sky level for mrgN20151214S0245:   1715.8
Transforming mrgN20151214S0246 to mrgN20151214S0246_trn

Transforming image mrgN20151214S0246[SCI] to image mrgN20151214S0246_trn
    Using transform mrgN20151214S0246_trn in database imcoadd.dat
Median sky level for mrgN20151214S0246:   1687.2
Median sky level for mrgN20151214S0243:   1736.9
Median sky level for mrgN20151214S0244:   1722.9
Transforming mrgN20151214S0243badpix +mask to mrgN20151214S0244badpix

Transforming image tmpmsk4367_1501 to image mrgN20151214S0244badpix
    Using transform mrgN20151214S0244_trn in database imcoadd.dat
Median sky level for mrgN20151214S0245:   1715.8
Transforming mrgN20151214S0243badpix +mask to mrgN20151214S0245badpix

Transforming image tmpmsk4367_1538 to image mrgN20151214S0245badpix
    Using transform mrgN20151214S0245_trn in database imcoadd.dat
Median sky level for mrgN20151214S0246:   1687.2
Transforming mrgN20151214S0243badpix +mask to mrgN20151214S0246badpix

Transforming image tmpmsk4367_1542 to image mrgN20151214S0246badpix
    Using transform mrgN20151214S0246_trn in database imcoadd.dat

Mean intensity for   mrgN20151214S0243_trn:  (N,absolute,relative)=  154  1836542  1.000
Mean intensity for   mrgN20151214S0244_trn:  (N,absolute,relative)=  154  1840278  1.002
Mean intensity for   mrgN20151214S0245_trn:  (N,absolute,relative)=  154  1834604  0.999
Mean intensity for   mrgN20151214S0246_trn:  (N,absolute,relative)=  154  1835561  0.999

Masking cosmic ray events in mrgN20151214S0243_trn
Applying growth radius 1
Masking cosmic ray events in mrgN20151214S0244_trn
Applying growth radius 1
Masking cosmic ray events in mrgN20151214S0245_trn
Applying growth radius 1
Masking cosmic ray events in mrgN20151214S0246_trn
Applying growth radius 1
IMCOADD exit status: good
-----------------------------------------------------------------------------

STEP 10: Inspect and save product


In [16]:
iraf.display(science['procsci']+'[sci,1]', 1, \
             zrange='no', zscale='no', z1=500, z2=10000)

shutil.copy(science['procsci'], products_path)

# Final reduced image
os.listdir(products_path)


z1=500. z2=10000.
Out[16]:
['ngc3310_g.fits', 'ngc3310_r.fits']

In [ ]: